import { defineStore } from 'pinia'
import { ref } from 'vue'
export const Userstore = defineStore('user', () => {
    const  userinfo =ref({})
    const token=ref('')
    //获取用户信息
    const getuserinfo=(data)=>{
        console.log(data);
            userinfo.value=data.data
            token.value=data.token   
    }
    const deluser=()=>{
      userinfo.value={}
      token.value=''
    }
  return { userinfo ,token,getuserinfo,deluser}
},{
  persist:true
})